package com.kwamecorp.brunoperry.kwamelogo.engine.shaders;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import android.content.Context;
import android.util.Log;

public class KCShader
{

	private Context context;

	public KCShader(Context context) {

		this.context = context;
	}

	public String loadShaderFile(int fileId)
	{
		String shaderData = "";
		InputStream inputStream = context.getResources().openRawResource(fileId);
		BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
		String readLine = null;

		try
		{
			while ((readLine = bufferedReader.readLine()) != null)
			{
				shaderData += readLine;
			}
		} catch (IOException e)
		{
			Log.d("KW", "error loading sahder file from resources");
		}
		return shaderData;
	}

}
